using System;
using System.Collections.Generic;
using System.Data.Linq.Mapping;
using InfoTech.Core.Data.Attributes;
using InfoTech.Core.Data.Dataable;
using InfoTech.Core.Data.Persistence;
using InfoTech.Utilities.Generic;

namespace InfoTech.LanTranh.MucVu.Bussiness
{
	[Serializable]
	[ExtraTable(Name = "sysdiagrams", Schema="dbo")]
	[Table(Name = "dbo.SYSDIAGRAMS")]
	public partial class SYSDIAGRAMS : ObjPersistence, IDeleteable, IUpdateable, IInsertable, ISelectable, IDeleteablebyId, IUpdateablebyId, ISelectablebyId
	{

		#region Fields

		private System.String _name;

		private System.Int32 _principal_id;

		private System.Int32 _diagram_id;

		private System.Int32? _version;

		private System.Byte[] _definition;

		#endregion

		#region Properties

		[ExtraColumn(DbType = "nvarchar", Length = 128, TypeName = "System.String", Type = typeof(System.String), CanBeNull = false)]
		[Column(Name = "name", DbType = "nvarchar(128)", IsPrimaryKey = false, CanBeNull = false)]
		public System.String NAME
		{
			get
			{
				return _name;
			}
			set
			{
				OnChanged(this, "NAME");
				_name = value;
			}
		}

		[ExtraColumn(DbType = "int", Length = 0, TypeName = "System.Int32", Type = typeof(System.Int32), CanBeNull = false)]
		[Column(Name = "principal_id", DbType = "int", IsPrimaryKey = false, CanBeNull = false)]
		public System.Int32 PRINCIPAL_ID
		{
			get
			{
				return _principal_id;
			}
			set
			{
				OnChanged(this, "PRINCIPAL_ID");
				_principal_id = value;
			}
		}

		[ExtraColumn(DbType = "int", Length = 0, TypeName = "System.Int32", Type = typeof(System.Int32), CanBeNull = false)]
		[Column(Name = "diagram_id", DbType = "int", IsPrimaryKey = true, CanBeNull = false)]
		public System.Int32 DIAGRAM_ID
		{
			get
			{
				return _diagram_id;
			}
			set
			{
				OnChanged(this, "DIAGRAM_ID");
				_diagram_id = value;
			}
		}

		[ExtraColumn(DbType = "int", Length = 0, TypeName = "System.Int32", Type = typeof(System.Int32), CanBeNull = true)]
		[Column(Name = "version", DbType = "int", IsPrimaryKey = false, CanBeNull = true)]
		public System.Int32? VERSION
		{
			get
			{
				return _version;
			}
			set
			{
				OnChanged(this, "VERSION");
				_version = value;
			}
		}

		[ExtraColumn(DbType = "varbinary", Length = 0, TypeName = "System.Byte[]", Type = typeof(System.Byte[]), CanBeNull = true)]
		[Column(Name = "definition", DbType = "varbinary", IsPrimaryKey = false, CanBeNull = true)]
		public System.Byte[] DEFINITION
		{
			get
			{
				return _definition;
			}
			set
			{
				OnChanged(this, "DEFINITION");
				_definition = value;
			}
		}

		#endregion

		#region Reflector

		public System.Type Reflector()
		{
			return typeof(SYSDIAGRAMS);
		}
		public object Current
		{
			get { return this; }
		}

		#endregion

	}
}
